package com.atguigu.system.utils;

import cn.hutool.core.bean.BeanUtil;
import com.atguigu.common.utils.BeanUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.List;

/**
 * <p>
 * PageUtils
 * </p>
 *
 * @author flyduck
 * @since 2023/10/24
 */
public class PageUtils {

    public static <T> Page<T> convertTo(Page page,Class<T> clazz){
        List records = page.getRecords();
        List<T> list = BeanUtils.toBeanList(records,clazz);
        page.setRecords(list);
        return page;
    }
}
